package com.pig4cloud.pig.sthcloud.clients;

import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import com.pig4cloud.pig.common.security.annotation.HasPermission;
import com.pig4cloud.pig.sthcloud.entity.TaskEntity;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author JRPF8P2
 */
@FeignClient(name = "pig-task-biz", path = "/taskInfo")
public interface TaskOpenFeginClients {
	/**
	 * 新增任务信息表
	 * @param task 任务信息表
	 * @return R
	 */
	@Operation(summary = "新增任务信息表" , description = "新增任务信息表" )
	@SysLog("新增任务信息表" )
	@PostMapping
	@HasPermission("task_taskInfo_add")
	 R save(@RequestBody TaskEntity task);

	/**
	 * 通过条件查询任务信息表
	 * @param task 查询条件
	 * @return R  对象列表
	 */
	@Operation(summary = "通过条件查询" , description = "通过条件查询对象" )
	@GetMapping("/details" )
	@HasPermission("task_taskInfo_view")
	 R getDetails(@SpringQueryMap TaskEntity task);

	/**
	 * 修改任务信息表
	 * @param task 任务信息表
	 * @return R
	 */
	@Operation(summary = "修改任务信息表" , description = "修改任务信息表" )
	@SysLog("修改任务信息表" )
	@PutMapping
	@HasPermission("task_taskInfo_edit")
	 R updateById(@RequestBody TaskEntity task);



}
